import { createStore } from 'vuex'
import mutations from './mutations'
import actions from './actions'
import getters from './getters'
import {getCookie} from "@/network/browser";
import {reactive} from "vue";
const state = reactive({
  user: {
    // 判断是否登录
    isLogin: getCookie('MUSIC_U') ? true : false,
    uid: -1,
    avatarUrl: require("@/assets/image/home/defaultAva.svg"),
    nickName: '未登录,请登录',
    // 动态
    event: 0,
    // 关注
    follows: 0,
    // 粉丝
    followeds: 0,
    // 是否需要弹出登录框
    isShowLoginDialog: false,
    beLoading: false
  },
  audio: [{}]
})
export default createStore({
  state,
  getters,
  mutations,
  actions,
})
